package chars;

import java.io.CharArrayReader;
import java.io.IOException;

/**
 * @Description
 * @Author zhaobaolin
 * @Date 2018/11/11
 */
public class CharArrayReaderExample {
    public static void main(String[] args) {
        demo();
    }
    private static void demo()
    {
        String source = "1234567890";
        int length = source.length();
        char[] c = source.toCharArray();
        try(CharArrayReader r = new CharArrayReader(c)){
            for(int i = 0;i < length; i++){
                System.out.print((char) r.read());
            }
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
